<template>
	<view class="container">
		<view class="top">
			<view class="head">
				<view class="InfoDetail">
					<image class="image" :src="userInfo.avatar"></image>
					<view class="user-box">
						<view class="userName">
							{{userInfo.nickname}}
						</view>
						<image src="../../static/icon/VIP.png" style="height: 66rpx;width: 66rpx;"></image>
					</view>

				</view>
				<view class="btnList">
					<view class="ziliao" @click="navZiliao">
						资料设置
					</view>
				</view>
			</view>
		</view>
		
		<!-- <view class="footer" style="background: #00008B;">
			<view class="tipPicture">
				<img src="../../static/icon/VIP.png" alt="" style="height: 60rpx;width: 60rpx;" />
				<view class="newTip">会员新上体验营速抢!</view>
			</view>
			<view class="vipNum">
				<view style="font-size: 30rpx;margin-right: 12rpx;">开通会员</view>
				<img src="../../static/icon/right-btn.png" alt="" style="height: 46rpx;width: 46rpx;" />
			</view>
		</view> -->

		<view class="tab">
			<view class="item" @click="navGongao(1)">
				<image src="../../static/icon/guanyuwome.png" class="icon"></image>
				<text class="text">关于我们</text>
			</view>
			<view class="item" @click="navGongao(2)">
				<image src="../../static/icon/gonggao.png" class="icon"></image>
				<text class="text">更新公告</text>
			</view>
			<view class="item" @click="navGongao(3)">
				<image src="../../static/icon/kefu.png" class="icon"></image>
				<text class="text">联系客服</text>
			</view>
			
			<audio src="C:\Users\Admin\Desktop\音乐"></audio>
		</view>


	</view>
</template>

<script>
	import Http from '../../utils/http'
	const http = new Http()
	var app = getApp()
	export default {
		data() {
			return {
				title: '个人中心',
				userInfo: {}
			}
		},
		onLoad() {
			http.get("v1/user/getUserInfo").then(res => {
				if (res.data.data.avatar) {
					res.data.data.avatar = app.globalData.baseHttp + res.data.data.avatar
				}
				this.userInfo = res.data.data
			})
			uni.showShareMenu({
				withShareTicket: true
			})
		},
		onShareAppMessage() {
			return {
				title: '模剪，傻瓜式制作有流量的视频',
				path: '/pages/index/index',
				imageUrl: 'https://jz-cnsiot.oss-cn-shanghai.aliyuncs.com/mojian/2024/3/28/1711607371526eab2a6157c4d4f22b17e09b737128967.png' // 指定分享时显示的图片链接
			}
		},
		//2.配置分享到朋友圈
		onShareTimeline() {
			return {
				title: '模剪，傻瓜式制作有流量的视频', //分享的标题
				query: '/pages/index/index', //点击分享链接之后进入的页面路径
				imageUrl: 'https://jz-cnsiot.oss-cn-shanghai.aliyuncs.com/mojian/2024/3/28/1711607371526eab2a6157c4d4f22b17e09b737128967.png' //分享发送的链接图片地址
			}
		},
		methods: {

			navZiliao() {
				uni.navigateTo({
					url: "/pages/Person/ziliao"
				})
			},
			navGongao(type) {
				uni.navigateTo({
					url: `/pages/Person/gonggao?type=${type}`
				})
			},

			upload() {
				wx.chooseVideo({
					sourceType: ['album', 'camera'], // 视频选择的来源，包括相册('album')和摄像头('camera')
					compressed: false,
					maxDuration: 60, // 拍摄视频最长拍摄时间，单位秒
					camera: 'back', // 默认拉起的是前置或后置摄像头
					success: (ress) => {
						console.log("res",ress);
						http.temUpload(ress.tempFilePath).then(res => {
							console.log(res.data);

						})
					},

				})
			}

		}
	}
</script>

<style scoped lang="scss">
	page {
		background: #f1f1f1;
	}

	.container {
		width: 100vw;
		min-height: 100vh;
		height: 100%;
		padding: 0rpx 20rpx;
		box-sizing: border-box;

		.top {
			// height: 300rpx;
			margin-top: 20rpx;
			background-color: rgb(1, 152, 213);
			width: 100%;
			border-radius: 20rpx;
			box-sizing: border-box;
			display: flex;
			flex-direction: column;
			padding-bottom: 30rpx;

			.head {
				display: flex;
				justify-content: space-between;
				margin: 30rpx 20rpx;

				.InfoDetail {
					display: flex;

					.image {
						height: 130rpx;
						width: 130rpx;
						border-radius: 65rpx;
						border: 4rpx solid #fff;
						margin-right: 20rpx;
					}

					.userName {
						font-size: 42rpx;
						font-weight: bold;
						color: white;
						white-space: nowrap;
						/* 不换行 */
						overflow: hidden;
						/* 隐藏溢出部分 */
						text-overflow: ellipsis;
						/* 显示省略号 */
						width: 300rpx;
						/* 设置元素宽度 */
					}
				}


				.btnList {

					display: flex;
					flex-direction: column;
					justify-content: space-around;

					.ziliao {
						height: 80rpx;
						width: 200rpx;
						line-height: 80rpx;
						margin: 0 auto;
						background-color: white;
						border-radius: 20rpx;
						text-align: center;
						font-size: 32rpx;
						color: #00008B;
						margin-bottom: 10rpx;
					}
				}
			}

			.num {
				width: 90%;
				margin: 0 auto;
				display: flex;
				align-items: center;
				justify-content: space-around;

				.jiNum {
					display: flex;
					flex-direction: column;
					align-items: center;
				}

				.qianNum {
					display: flex;
					flex-direction: column;
					align-items: center;
				}
			}


		}

		.footer {
			background: orange;
			padding: 20rpx;
			display: flex;
			border-bottom-left-radius: 20rpx;
			border-bottom-right-radius: 20rpx;
			justify-content: space-between;

			.tipPicture {
				display: flex;
				align-items: center;

				.newTip {
					font-size: 30rpx;
					color: white;
				}
			}

			.vipNum {
				display: flex;
				align-items: center;

			}
		}

		.tab {
			display: flex;
			padding: 20rpx 40rpx;
			background: #fff;
			justify-content: space-around;
			margin-top: 50rpx;
			border-radius: 20rpx;

			.item {
				flex: 1;
				display: flex;
				flex-direction: column;
				align-items: center;

				.icon {
					width: 80rpx;
					height: 80rpx;
				}

				.text {
					font-size: 30rpx;
					color: #333;
					margin-top: 10rpx;
				}
			}
		}
	}
</style>